package mk.gamemap.model.gameevent
{
	import flash.events.EventDispatcher;
	
	import mk.gamemap.model.GameVar;
	import game.tileMap.model.vo.MapObj;
	
	import mx.events.DynamicEvent;

	public class DoorEvt extends GEvent
	{
		
		public function DoorEvt(mapSp:MapObj)
		{
			super(mapSp)
			mapSp.picId="2"
			
		}
		
		
		
		override protected function updateList():void{
			
			if (progress==0){
				var dyEvent:DynamicEvent=new DynamicEvent(GEvent.EVENT_COMMAND);
				dyEvent.txt="芝麻开门！haha,speak ,speak\ntalk"
				//dispatchEvent(dyEvent);
				progress++
				return;
				
			}else if (progress==1){
				if (!isOpen){
					isOpen=true;
					gameVar.key1--;
					trace(gameVar.key1+"开门"+mapSp)
					mapSp.through=true;
					mapSp.picId="";
					progress++
				}
			}
		}
	}
}